//
//  MZYCollectionViewCell.m
//  WristWatch
//
//  Created by dllo on 15/10/27.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "MZYCollectionViewCell.h"

@implementation MZYCollectionViewCell


- (void)dealloc {
    [_myImageView release];
    [_myLabel release];
    
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height)];
        [self.contentView addSubview:self.myImageView];
        [_myImageView release];
        
        self.myLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, self.contentView.frame.size.height / 6 * 5, self.contentView.frame.size.width - 10, self.contentView.frame.size.height / 6)];
        // 毛玻璃效果
        UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
        // iOS8.0之后出现的新效果, 用来显示模糊效果
        UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect];
        effectView.alpha = 0.5;
        effectView.backgroundColor = [UIColor blackColor];
        effectView.frame = CGRectMake(0, 0, self.myLabel.frame.size.width, self.myLabel.frame.size.height);
        // 添加子视图
        [self.myLabel addSubview:effectView];
        self.myLabel.font = [UIFont systemFontOfSize:13];
        self.myLabel.numberOfLines = 0;
//        self.myLabel.backgroundColor = [UIColor whiteColor];
        self.myLabel.textColor = [UIColor whiteColor];
//        self.myLabel.alpha = 0.5;
        [self.contentView addSubview:self.myLabel];
        [_myLabel release];
        

    }
    return self;
}





@end
